4.1 Finding necessary Includefiles for a PPob-class
4.2 Finding nescessary Includefiles for a source-file
Include Checker is designed to aid you in setting up C++-Projects in Metrowerks Codewarrior.
Have you ever added a PowerPlant-Class or a file from your personal library to an existing project and found yourself in repeatedly adding more and more missing files, which were referenced in the just added one(s) ?
Include Checker can do this job for you !
The program is a Fat-Application and should work on 68k and Power Macs. If not, let me know. If you use a system version before 7.6.1, the "object supportlib" is required. It has been tested with System 7.5.3 and later versions. The 68k Version has been tested in emulation modus on a PowerPC and on a 6040LC Processor machine. So I can only say, it should work at least on 68020 machines and better. Let me know if you have problems running it on other machines.
There are no special installation hints. Put the program folder somewhere on your harddisk.
Include Cecker sets up and maintains a list of source files (*.h, *.cp, *.c, *.cpp) which are contained somewhere on your harddisk. If you ask Include Checker to add a specific file to the actual project in the CW-IDE, "Include Checker" parses this file and all subsequently referenced header and source files. Sourcefiles can only be found if they have the same name as the headerfile. This parsing process goes on, until no more new files are referenced. To exclude the whole lot of ANSI- and MacHeader-Files from the parsing process, Include Checker follows only files, which are containend in the fileset you have to setup (see "Folders"- and "Files"-page).
After finding all referenced Includefiles, "Include Checker" queries the CW-IDE for all assigned source files it can find (files with the same name and a *.c, .*cp or *.cpp extension), to be in the current project. If not, the files which had not already been in the project are added to the missing files list. You can manually modify the list and add all the missing files to the project at once. There are also code templates for #include- and "RegisterClass" statements, which you can drag and drop into your sourcefiles. So setting up projects or adding some library files can be done faster.
The user interface is built up from a small window with 5 pages one of which is visible at a time. The pages are called "Input", "Headers", "Source", "Files" and "Folders". They can be reached by clicking on the page buttons on top of the window. "Files" and "Folders" are only important to set up the Fileset.
Start the program and select "New" from the File Menu. The window that opens should look like the one you see below. You have just created a new fileset, with no actual file in it right now.
The text in the list area indicates that the Fileset is empty.
Before you can take advantage of Include Checker you have to set up the fileset. To do this, move to the rightmost page in the main window by clicking into the right arrow on the top of the window and click on the "Folders" Pagebutton. The screen should now look like picture 2 (in your case the list is still empty ).
There are two different ways to add files to the fileset. The first one looks into every header file to see if there is a class deklaration in it, which contains a "class_id"-definition. Found classes, are added to the class-list (see "Input"-page). The second way to add files is much faster, because no parsing is done. The only disadvantage is, that you won't be able to select classes from the class-list. Instead you have to select the source or header file from the Filedialog.
If you have added some folders (at least you should add the "Power Plant Folder" and some of your source folders) you can switch back to the "Input" page, by clicking the left arrow on top of the window. Be sure to save the Fileset ("Include Checker" otherwise asks you to save changes to the Fileset when you try to quit).
Removes a folder, all containing subfolders and files from the fileset.
The Rescan operation first removes the selected folder from the fileset and adds it as a source folder (no parsing).
Go to the "Input"-page if it's not already open. This is the first
page you see after startup. Picture 4 shows how it looks like
if you have added the Power Plant Files.
This is what the buttons are for:
Switch to the "Input"-page. Select a class in the list on top of the buttons. The "Find Headers"-button will become active. Push the button and "Include Checker" starts to parse for all #include-statements in the associated header and the source-file ( if it finds one). The "File"-area shows the currently operated file. A short string is shown on the bottom of the window, which tells you what "Include Checker" currently does. "Parse file" indicates that the file has not already been parsed. Include Checker copies all Include files it finds in a list, so that it can access the Inlcude much faster, if the file is referenced later again. If the file has not already been parsed, "Getting Includes" is shown. This is much faster, because Include Checker onlx has to copy the list of includes to current workspace. Parsing of files may take 1 to 2 seconds. It can take some more seconds if a *.c-file is parsed or if the "Scan source files fast" option is not checked.
On the "Input"-page, push the "Select File"-button to open the Filedialog. Select a source or header file. ! Be sure the file is contained in the Fileset ! If not so, "Include Checker" will complain about this and won't search for includes. To add a single file to the fileset, switch to the "Files"-page and add the file with the "Add"-Button. If you wish the file to be parsed for PPob-IDs (see Section 1 for more information on that), switch to the "Folders"-page and push the "Add File "-button from the "Parse PPob IDs" box area.
You can abort the process of finding Includefiles by pressing 'Command' + '.'
To sort the classes list, click on the Column title. The underlined title indicates the current sort column. Right now there is no way to jump to specific Classes or IDs by typing characters.
Sometimes you may have removed a class from your own sources and want to remove it from the list also. You can delete items from the class list by selecting the class and press the "delete" or "backward delete" key. Confirm the security check, if you really want to remove the class from the list. You can add accidently removed classes on the "Folders"-page.
The "Source"-page conatins a list of every missing source file. If the list is empty, no file is missing in the currently active project. Be sure the CW-IDE is running and has an opened project. The currently active project, if there is one, is shown on the bottom of the page. If the field is blank there is no active project and "Include Checker" can't query the IDE for missing files.
A click on the '+'/'-' sign on the left of the list toggles the state of the file. Only files with a '+'-sign on the left of it will be added to the project. This allows you to exclude files which should not be included for certain reasons. For sample "UDesktop" which is often marked as missing, but the project contains "UFloatingDesktop" as replacement for UDesktop, so adding this file would create a lot of "doubly defined" linker errors. "UException" also may cause linker errors. You have to find out yourself what really needs to be added !
To add the selected files to th current project, push the button shown below. The button becomes only active if there are selected files.
If your project has different targets, the newly added files from "Include Checker" are added to the current target only. You have to manuallly add these files to other targets by selecting the newly added sourcefiles and opening the "Project Inspector" window in the CW IDE.
The two buttons on the bottom of the page can be dragged to your sourcefiles. As PowerPlant requires to register all PPob-Classes that are loaded from the PPob Resource File, every newly added class has to be included in the source code and registered with the "Register_Class"-Macro in the Konstruktor of your application class.
The two buttons hold the necessary sourcetemplates, so you do not have to type them by hand.
The "Files"-page shows all files in the fileset. You can add or remove single files from the Fileset if you wish so. Here you can also inspect the full pathname of a single file.
The number on the right of the filename shows how many includefiles (from within the fileset !) are found if the file was scanned at least once. A double click on the filename parses the file immediately. If you change the fileset by adding or deleting files or folders, the internal cache, which holds the names of inlcudefiles for each file, is reset.
Use the "Remove" button to exclude one or more files from the fileset (hold down 'Command'-key to select multiple files).
See section 3 "Setup" for a description of the "Folders"-page.
In the preference panel you can set options for startup action and file parsing.
If you like "Include Checker", please register. The cost for a single user license is 10$. See the Readme file for more information and pricing options. If you register I will let you know as soon as new versions are out. Use the Register-program contained in the folder to pay register fees via Kagi. "Include Checker" is not restricted in any way. I will do further developing and make it publicly available only, if somebody is interested in it. So please let me know if you think it is useful for you and tell me if you would like to see features that are not already in it. Right now I think about Drag&Drop from the fileset, better fileset management, options to automatcally exclude files from the missing files list and … .
If you have any problem with "Inlcude Checker" or have any suggestions for the program please let me know.
Have fun !
Thomas Rorig